package models

import (
	"time"
)

type Players struct {
	ID         uint      `gorm:"primary_key"`
	UserID     uint      `gorm:"type:varchar(100);index:user_id;not_null" json:"user_id"`
	GameID     uint      `gorm:"type:int;index:game_id;not_null" json:"game_id"`
	Color      string    `json:"color"`
	Score      uint      `json:"score"`
	Ranking    int8      `gorm:"type:int;default:0" json:"ranking"`
	IsChampion bool      `gorm:"type:tinyint(1);default:0" json:"is_champion"`
	JoinTime   time.Time `gorm:"type:datetime;default:CURRENT_TIMESTAMP"`
}
